package com.demo.mapper;

import com.demo.common.MapperException;
import com.demo.entity.RoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author libo
 * @version 1.0
 * @date 2018/4/27 9:49
 */
@Mapper
public interface IRoleMapper {

    /**
     * 添加对象
     *
     * @param entity
     * @return 主键ID
     */
    Long save(RoleEntity entity) throws MapperException;


    /**
     * 修改对象
     *
     * @param entity
     * @return
     */
    Integer update(RoleEntity entity) throws MapperException;


    /**
     * 删除对象
     *
     * @param pkId
     * @return
     */
    Integer remove(Long pkId) throws MapperException;


    /**
     * 获取对象
     *
     * @param pkId
     * @return
     */
    RoleEntity get(Long pkId) throws MapperException;

    /**
     * 根据查询条件查询集合
     *
     * @return
     */
    List<RoleEntity> listByQuery(@Param("params") Map<String, Object> params) throws MapperException;
}
